// https://leetcode.com/problems/pascals-triangle-ii/description/
class Solution {
public:
    vector<int> getRow(int rowIndex) {
        if (rowIndex == 0)
            return {1};
        vector<int> vec(rowIndex + 1);
        vec[0] = 1;
        vec[rowIndex] = 1;
        vector<int> temp = getRow(rowIndex - 1);
        for (int i = 1; i < rowIndex; i++)
        {
            vec[i] = temp[i - 1] + temp[i];
        }
        return vec;
    }
};
